<template>
  <div class="child">
    男<input name="sex" type="radio" :checked="gender === '男'" @click="handleGender('男')">
    女<input name="sex" type="radio" :checked="gender === '女'" @click="handleGender('女')">
  </div>
</template>

<script>
  export default {
    name:'Child',
    props:['gender','updateGender'],
    methods: {
      handleGender(value){
        // 想办法联系父，让父去修改gender
        this.updateGender(value)
      }
    },
  }
</script>

<style scoped>
  .child {
    background-color: skyblue;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px;
  }
</style>